1. Field of the Invention
The present invention relates to a video encoding scheme that encodes a video by at least two times of encoding, particularly a video encoding method and apparatus which analyzes statistical nature of an input video based on the first time encoding result, and performs the second time encoding based on the analysis result.
2. Description of the Related Art
The storage media from which variable bit rate data is readable and which is represented as DVD (Digital Versatile Disc) realizes video compression of high efficiency in a constant disc capacity by using video encoding of a variable bit rate in recording a video signal. For example, MPEG2 (Moving Picture Experts Group phase 2) video encoding scheme is adopted in the DVD.
Since entropy coding is used in MPEG2, the number of bits that is necessary for obtaining a constant picture quality varies according to resolution of an input video or speedy of movement thereof.
Therefore, varying the bit rate according to nature of the video enables to lower an average bit rate in comparison with encoding of a constant bit rate, resulting in reducing the total number of bits.
In a video encoding used for recording video data on a storage media such as the DVD, so-called 2 path encoding to encode the video data two times is performed in order to realize the most suitable bit allocation On Jpn. Pat. Appln. KOKAI Publication No. 8-186821, for example, is disclosed a technique that acquires statistical data in units of one frame by first time encoding, allocates the number of bits in units of one frame over the whole video sequence based on the statistical data, and performs the second time encoding with a variable bit rate.
A MPEG 4 (Moving Picture Experts Group phase 4) video encoding scheme which is directed to encoding a video signal with a bit rate lower than a recording bit rate of DVD for video transmission in an internet and a mobile terminal is standardized in 1999. MPEG 4 is a video encoding scheme providing with various functionality expansions, such as enhancement of compression efficiency, reinforcement of error resilience, various functionality expansions representative of object encoding, in comparison with MPEG 2. MPEG 2 is based on encoding at a constant frame rate assuming a television signal and a cine film. In contrast, MPEG 4 enables encoding at an arbitrary frame rate by using a frame skip in order to realize encoding of a low bit rate.
The picture quality under the same average bit rate is greatly influenced by how a frame rate is controlled in dynamic in the MPEG 4 video encoding scheme. A method of encoding the video by detecting presence of movement of the input image beforehand and changing a frame rate every scene as described in Jpn. Pat. Appln. KOKAI Publication No. 2000-350211, for example, is known.
It is required in MPEG2 and MPEG 4 video encoding schemes to encode video data with such rate control that underflow and overflow of a buffer do not occur in a receiving buffer model in a virtual decoder as referred to as VBV (Video Buffering Verifier). However, Jpn. Pat. Appln. KOKAI Publication No. 2000-350211 does not consider administration of VBV.
Further, the operation of VBV is a buffer variable model to perform in units of a frame. Therefore, it is necessary for realizing allocation of the number of bits for the control of VBV and the high efficient encoding to estimate in precision the number of generated bits in units of one frame. In MPEG2 and MPEG 4, if a frame skip is performed, an interframe predictive coding is executed. For this reason, the frame interval between a prediction picture and a reference picture increases, and the prediction efficiency degrades, resulting in degrading the coding efficiency often. Therefore, it become difficult to predict the number of generated bits in the second encoding in the first encoding, if the position of frame skip differs between the first encoding and the second encoding.
As describe above, the video encoding technology based on the conventional 2 path encoding has a problem making difficult to allocate the optimum number of bits in accuracy under VBV administration, when the interframe predictive coding of variable frame rate is performed in the second encoding.
It is an object of the present invention to provide a video encoding method of encoding a video at high efficiency by 2 path encoding that can allocate the optimum number of bits in an interframe predictive coding of a variable frame rate and an apparatus therefor.
It is another object of the present invention to provide a video encoding method enabling an accurate VBV administration and allocation of the optimum number of bits in 2 path encoding.